package com.kui.demo.repeatsubmit;


import java.util.HashMap;
import java.util.Map;

public class SimpleRepeatSubmitTicket extends AbstractRepeatSubmitTicket {

    private static Map<String, Long> cache = new HashMap<>();

    @Override
    public Long getTicketTimestamp(String ticket) {
        return cache.getOrDefault(ticket, 0L);
    }

    @Override
    public void putTicketTimestamp(String ticket) {
        cache.put(ticket, System.currentTimeMillis());
    }

    @Override
    public void removeTicketTimestamp(String ticket) {
        cache.remove(ticket);
    }
}
